From ec34c4bd83fab5a0b043f49182a6644e5d5f4647 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 22 May 2011 03:53:21 +0200 Subject: [PATCH] themingeninge: Handle translations properly We want to keep the location of where to render, but transform th context by the pango transform. --- gtk/gtkthemingengine.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c index 19b6dfc83d..4ae5904a4b 100644 --- a/gtk/gtkthemingengine.c +++ b/gtk/gtkthemingengine.c @@ -2370,29 +2370,18 @@ prepare_context_for_layout (cairo_t *cr, matrix = pango_context_get_matrix (pango_layout_get_context (layout)); + cairo_move_to (cr, x, y); + if (matrix) { cairo_matrix_t cairo_matrix; - PangoRectangle rect; cairo_matrix_init (&cairo_matrix, matrix->xx, matrix->yx, matrix->xy, matrix->yy, matrix->x0, matrix->y0); - pango_layout_get_extents (layout, NULL, &rect); - pango_matrix_transform_rectangle (matrix, &rect); - pango_extents_to_pixels (&rect, NULL); - - cairo_matrix.x0 += x - rect.x; - cairo_matrix.y0 += y - rect.y; - - cairo_set_matrix (cr, &cairo_matrix); - cairo_move_to (cr, 0, 0); - } - else - { - cairo_move_to (cr, x, y); + cairo_transform (cr, &cairo_matrix); } } -- 2.30.2